<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/3/17
 * Time: 17:28
 */

namespace Admin\Model;
use Think\Model;

/**
 * Class NatureModel
 * @package Admin\Model
 * 属性管理
 */
class NatureModel  extends Model
{
    protected $pk='nid';
    protected $tableName='nature';
    /**
     * @param $data
     * 属性添加和修改
     */
     public function store($data){
//        dd($data);die;
         $action=isset($data['nid'])?'save':'add';
         $res=$this->$action($data);
         if($res){
             return ['valid'=>1,'msg'=>'操作成功'];
         }else{
             return ['valid'=>0,'msg'=>'操作失败'];
         }
     }
    /**
     * 查找出旧数据
     */
    public  function alldate(){
        return $this->select();
    }
}